#ifndef	__UASGAME_H__
#define	__UASGAME_H__
#include"globaldefine.h"
#include<vector>
#include"UASObject.h"
#include"UASSpritePool.h"

using namespace std;


class UASObject;								//	predeclaration ,avoid do not know the class UASObject.

/**
	Manage all UASObject in application.Keep a vector<> for them.
*/
class UASObjManager
{
private:
	static UASObjManager* _instance;
	UASObjManager(){};
	vector<UASObject*> _objList;

public:
	static UASObjManager* GetInstance();
	static void CleanUp();
	virtual ~UASObjManager(){};
	
	void InsertObject(UASObject* pCurObj);
	void RemoveObject(UASObject* pCurObj);

	void Tick(float timeDelta);
	void Render();
};

/**
	UASGame class include all test game logic.
	I don't want game logic code every where, so I try to put game logic together.
*/
class UASGame
{
protected:

public:
	const UASSpritePool* const _pSpritePool;
	UASObjManager* _pObjManager;
public:
	UASGame();
	~UASGame();

	void Init();
	void CleanUp();

	void Tick(float timeDelta);
	void Render();

	//	test code
	UASSprite* _pMannySprite;
	const static int _renderingAnimIdx = 9;
	int _paintingAFrameIdx;
	int _nRenderingAnimFrames;
	int _xPos,_yPos;

};

#endif	//__UASGAME_H__